From 52ae2445d4cd4998c15769b55097a912253a3888 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 13 Sep 2005 20:54:41 +0000 Subject: [PATCH] Switch shutdown and sysrq to xstransact. Signed-off-by: Christian Limpach --- tools/python/xen/xend/XendDomainInfo.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 85f6abcdd8..8ac581241d 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -1055,21 +1055,15 @@ class XendDomainInfo: def shutdown(self, reason): if not reason in shutdown_reasons.values(): raise XendError('invalid reason:' + reason) - db = self.db.addChild("/control"); - db['shutdown'] = reason; - db.saveDB(save=True); + xstransact.Write(self.path, "control/shutdown", reason) if not reason in ['suspend']: self.shutdown_pending = {'start':time.time(), 'reason':reason} def clear_shutdown(self): - db = self.db.addChild("/control") - db['shutdown'] = "" - db.saveDB(save=True) + xstransact.Remove(self.path, "control/shutdown") def send_sysrq(self, key=0): - db = self.db.addChild("/control"); - db['sysrq'] = '%c' % key; - db.saveDB(save=True); + xstransact.Write(self.path, "control/sysrq", '%c' % key) def shutdown_time_left(self, timeout): if not self.shutdown_pending: -- 2.30.2